<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%@include file="cabecera.jsp" %>  
	<form name="f1" action="InsExtServlet" method="post" style="height: 188px; ">
	Registro de instrumento de Cliente
	 <table border="0">
    

    
    <% String idclie =  session.getAttribute("USUARIO_ACTUAL").toString();%>
    <tr><td>Id Cliente</td><td><input type="text" name="txtCli" disabled="disabled" value=<% out.print(idclie); %>></td></tr>
    <tr><td>Intrumento</td><td>
    <select NAME="selCombo" SIZE=1> 
    <%@page import="java.util.*, studio.modelo.Instrumento, studio.modelo.InstExterno" %>
	<%
		Collection<Instrumento> arreglo = (ArrayList<Instrumento>)request.getAttribute("Instrumentos");
		if(arreglo != null) { 
		int i = 1;
		for(Instrumento x : arreglo) {
		%>  
		 <option VALUE=<% out.print(x.getIdInstrumento()); %>><% out.print(x.getCaracteristicas()); %></option> 
		<% }  
  			} %>
         </select></td></tr>
           
    <tr><td>Cantidad</td><td><input type="text" name="txtCantidad"></td></tr>
    <tr><td>Caractersiticas Adicionales </td><td><input type="text" name="txtCaract"></td></tr>
    <tr><td><input type="reset" value="Cancelar">
			</td><td><input type="submit" value="Registrar Instrumento">
			</td></tr>
    </table>
	
		<table width="550" height="50" border="1" cellpadding="0" cellspacing="0">
  <tr>
    <th width="100" scope="col">Usuario</th>
    <th width="150" scope="col">Caracteristica Propietario</th>
    <th width="100" scope="col">Caracteristicas</th>
    
  </tr>


<%

Collection<InstExterno> arreglo2 = (ArrayList<InstExterno>)request.getAttribute("IntrumentosCli");
if(arreglo2 != null) { 
int y = 1;
for(InstExterno w : arreglo2) {
%>  


  <tr>
    <td><% out.print(w.Cliente.getIdUsuario()); %></td>
    <td><% out.print(w.getCaracteristicasAdicionales()); %></td>
    <td><% out.print(w.getCaracteristicas()); %></td>
   
  </tr>
<% }  
  } %>
  
</table>

	</form>
	
	<%
int swe = 0;
        swe= Integer.parseInt(session.getAttribute("msa").toString());
        switch (swe) {
        case 1: %><script type="text/javascript"> alert("Ya se ha ingresado el Instrumento al cliente");</script>
        		<% break;
        case 2: %><script type="text/javascript"> alert("Intrumento Insertado Correctamente");</script>
		<% break;
      



        }%>
	
	
	
	<%@include file="pie.jsp" %>  
</body>
</html>